/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;

/**
 *
 * @author vimi Administrator
 */




public class ObjectiveFunction {
    public int [][] assigned_Solution;

    public int w1=200, w2=150, w3=100, w4=50; // originally 200 100 100 50
    public int sw1=15, sw2=15, sw3=10, sw4=10;

    public int HC1=0, HC2=0, HC3=0, HC4=0;
    public int SC1=0, SC2=0, SC3=0, SC4=0;

    public ObjectiveFunction()
    {
        
    }

    public ObjectiveFunction(ObjectiveFunction Value)
    {
        this.HC1 = Value.HC1;
        this.HC2 = Value.HC2;
        this.HC3 = Value.HC3;
        this.HC4 = Value.HC4;

        this.SC1 = Value.SC1;
        this.SC2 = Value.SC2;
        this.SC3 = Value.SC3;
        this.SC4 = Value.SC4;
    }

    public ObjectiveFunction(int []HCArray,int []SCArray)
    {
        HC1 = HCArray[0];
        HC2 = HCArray[1];
        HC3 = HCArray[2];
        HC4 = HCArray[3];

        SC1 = SCArray[0];
        SC2 = SCArray[1];
        SC3 = SCArray[2];
        SC4 = SCArray[3];

    }

    public void copyFrom(ObjectiveFunction Value)
    {
        this.HC1 = Value.HC1;
        this.HC2 = Value.HC2;
        this.HC3 = Value.HC3;
        this.HC4 = Value.HC4;

        this.SC1 = Value.SC1;
        this.SC2 = Value.SC2;
        this.SC3 = Value.SC3;
        this.SC4 = Value.SC4;
    }

    public int valueHC()
    {
        return HC1 + HC2 + HC3 + HC4;
    }

    public int valueHCwW()
    {
        return w1*HC1 + w2*HC2 + w3*HC3 + w4*HC4;
    }

    public int valueSC()
    {
        return SC1 + SC2 + SC3 + SC4;
    }

    public int valueSCwW()
    {
        return sw1*SC1 + sw2*SC2 + sw3*SC3 + sw4*SC4;
    }

    public int value()
    {
        return w1*HC1 + w2*HC2 + w3*HC3 + w4*HC4 +
               sw1*SC1 + sw2*SC2 + sw3*SC3 + sw4*SC4;
    }

    

    /*
    public int returnViolationsOF(InputReader _inputReader, int [][] _Solution)
    {
        PernaltyCounter _PenaltyCounter = new PernaltyCounter();
        this.attachTo(_PenaltyCounter);
        _PenaltyCounter.CP_R_Solution = _Solution;

        

        return w1*_PenaltyCounter.AllLecturesOnTT()+
               w2*_PenaltyCounter.RoomOccupancy()+
               w3*_PenaltyCounter.sameCurriculumLecturesConflict(_inputReader.HardCurriculum_Matrix, this.Cs_sortedCs_Mapping)+
               w3*_PenaltyCounter.sameTeacherLecturesConflict(_inputReader.Courses_waTeacher_Matrix, this.Cs_sortedCs_Mapping)+
               w4*_PenaltyCounter.TeacherAvailabilities(_inputReader.C_P_UnavailabilityMatrix, this.Cs_sortedCs_Mapping)
               ;
    }
     * 
     */

}
